void __attribute__((naked,noinline)) sub_FFC5F6A8_my(){
asm volatile(
                "LDR     R12, =0x201E\n"
                "STMFD   SP!, {R4,LR}\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC5F768\n"
                "BGT     loc_FFC5F704\n"
                "LDR     R12, =0x2004\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC5F770\n"
                "BGT     loc_FFC5F6EC\n"
                "SUB     R12, R0, #0x1000\n"
                "SUBS    R12, R12, #0xA9\n"
                "SUBNE   R12, R0, #0x1000\n"
                "SUBNES  R12, R12, #0xAD\n"
                "SUBNE   R12, R0, #0x1000\n"
                "SUBNES  R12, R12, #0xAF\n"
                "BNE     loc_FFC5F780\n"
                "B       loc_FFC5F768\n"
"loc_FFC5F6EC:\n"
                "SUB     R12, R0, #0x2000\n"
                "SUBS    R12, R12, #5\n"
                "SUBNE   R12, R0, #0x2000\n"
                "SUBNES  R12, R12, #0x1D\n"
                "BNE     loc_FFC5F780\n"
                "B       loc_FFC5F768\n"
"loc_FFC5F704:\n"
                "LDR     R12, =0x5004\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC5F768\n"
                "BGT     loc_FFC5F730\n"
                "SUB     R12, R0, #0x3000\n"
                "SUBS    R12, R12, #0xA\n"
                "BEQ     loc_FFC5F764\n"
                "SUB     R12, R0, #0x5000\n"
                "SUBS    R12, R12, #1\n"
                "BNE     loc_FFC5F780\n"
                "B       loc_FFC5F768\n"
"loc_FFC5F730:\n"
                "SUB     R12, R0, #0x5000\n"
                "SUBS    R12, R12, #6\n"
                "BEQ     loc_FFC5F768\n"
                "SUB     R12, R0, #0x5000\n"
                "SUBS    R12, R12, #7\n"
                "BNE     loc_FFC5F780\n"
                "BL      sub_FFC1C9B0\n"
                "LDR     R1, =0x59D0\n"
                "LDR     R0, [R1,#0x10]\n"
                "CMP     R0, #7\n"
                "LDREQ   R0, [R1,#0x18]\n"
                "BLEQ    sub_FFC6001C\n"
                "B       loc_FFC5F778\n"
"loc_FFC5F764:\n"
                "BL      sub_FFC1BF64\n"
"loc_FFC5F768:\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC5F50C_my\n"  //------------>
"loc_FFC5F770:\n"
                "BL      sub_FFC5E570\n"
                "BL      sub_FFC5EFA0\n"
"loc_FFC5F778:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4,PC}\n"
"loc_FFC5F780:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
}


void __attribute__((naked,noinline)) sub_FFC5F50C_my(){
asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "BL      sub_FFC60180\n"
                "CMP     R0, #1\n"
                "BLEQ    sub_FFC60268\n"
                "LDR     R4, =0x59D0\n"
                "MOV     R5, #1\n"
                "LDR     R0, [R4,#0x24]\n"
                "CMP     R0, #0\n"
                "LDRNE   R0, [R4,#0x4C]\n"
                "CMPNE   R0, #0\n"
                "BEQ     loc_FFC5F578\n"
                "BL      sub_FFC60180\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC5F578\n"
                "BL      sub_FFC60268\n"
                "LDR     R0, [R4,#0x78]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC5F578\n"
                "LDR     R1, =0xFFC5F688\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC59164\n"
                "BL      sub_FFD6F9CC\n"
                "BL      sub_FFD6F958\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x51\n"
                "BL      sub_FFC67E50\n"
                "STR     R5, [R4,#0x78]\n"
"loc_FFC5F578:\n"
                "BL      sub_FFC60180\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC5F5C4\n"
                "LDR     R0, [R4,#0x44]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC5F5C4\n"
                "LDR     R0, [R4,#0x74]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC5F5C4\n"
                "LDR     R1, =0xFFC5F69C\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC59164\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x8C\n"
                "BL      sub_FFC67E50\n"
                "BL      sub_FFC661D0\n"
                "MOV     R0, #0x21\n"
                "BL      sub_FFC67E90\n"
                "STR     R5, [R4,#0x74]\n"
"loc_FFC5F5C4:\n"
                "LDR     R0, [R4,#0x38]\n"
                "CMP     R0, #0\n"
                "LDRNE   R0, [R4,#0x3C]\n"
                "CMPNE   R0, #0\n"
                "LDRNE   R0, [R4,#0x44]\n"
                "CMPNE   R0, #0\n"
                "LDRNE   R0, [R4,#0x48]\n"
                "CMPNE   R0, #0\n"
                "LDRNE   R0, [R4,#0x1C]\n"
                "LDRNE   R1, [R4,#0x20]\n"
                "ORRNES  R0, R0, R1\n"
                "BEQ     loc_FFC5F600\n"
                "BL      sub_FFC5EE40\n"
                "BL      sub_FFC5EFA0\n"
                "B       loc_FFC5F624\n"
"loc_FFC5F600:\n"
                "LDR     R0, [R4,#0x58]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC5F62C\n"
                "BL      sub_FFC5EE88\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC5F62C\n"
                "BL      sub_FFC61808\n"
                "BL      sub_FFC617C4\n"
                "BL      sub_FFC60058\n"
"loc_FFC5F624:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
"loc_FFC5F62C:\n"
                "BL      sub_FFC5EE88\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC5F654\n"
                "LDR     R0, [R4,#0x7C]\n"
                "CMP     R0, #0\n"
                "BLEQ    sub_FFC602AC_my\n"  //------------>
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x70]\n"
                "STR     R0, [R4,#0x74]\n"
                "STR     R0, [R4,#0x78]\n"
"loc_FFC5F654:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
);
}


void __attribute__((naked,noinline)) sub_FFC602AC_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC604D0\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC59164\n"
                "BL      sub_FFC1C178\n"
                "BL      sub_FFC605D4\n"
                "BL      sub_FFC63CF0_my\n"  //------------>
                "MOV     R0, #1\n"
                "BL      sub_FFC5E918\n"
                "BL      sub_FFC5EDC4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC5F034\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC63CF0_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "LDR     R1, =0xFFC63EE8\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC59164\n"
                "LDR     R4, =0x5D04\n"
                "MOV     R0, #6\n"
                "MOV     R5, #1\n"
                "STR     R0, [R4,#0x5C]\n"
                "STR     R5, [R4,#0x10]\n"
                "BL      sub_FFD23220\n"
                "BL      sub_FFD3381C\n"
                "BL      sub_FFD29F74\n"
                "BL      sub_FFD27A38\n"
                "BL      sub_FFC6426C_my\n" //------------->
                "BL      sub_FFD343E0\n"  
                "BL      sub_FFD325BC\n"
                "BL      sub_FFD336C4\n"
                "MOV     R0, #1\n"
                "STR     R5, [R4,#0x18]\n"
                "BL      sub_FFC64350\n"
                "MOV     R0, #3\n"
                "STR     R0, [R4,#0x68]\n"
                "LDR     R1, [R4,#0x6C]\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "MOV     R0, #0\n"
                "BX      R1\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC6426C_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "MOV     R0, #1\n"
                "BL      sub_FFD2ABCC\n"
                "LDR     R0, =0x855\n"
                "BL      sub_FFD1E778\n"
                "BL      sub_FFC1BF64\n"
                "BL      sub_FFC63AC8_my\n"  //---------------->
                "BL      sub_FFD22AB8\n"
                "BL      sub_FFD1C5D8\n"
                "BL      sub_FFD2B008\n"
                "BL      sub_FFD2B5E4\n"
                "BL      sub_FFD32194\n"
                "BL      sub_FFD2B7D4\n"
                "BL      sub_FFD33BFC\n"
                "BL      sub_FFD33378\n"
                "BL      sub_FFD2B1E0\n"
                "BL      sub_FFD32D24\n"
                "BL      sub_FFD2AA04\n"
                "BL      sub_FFD31D78\n"
                "BL      sub_FFD288A4\n"
                "BL      sub_FFC67FC4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC67C8C\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC63AC8_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R0, =0x5D74\n"
                "LDR     R1, =sub_FFC63898_my\n"    //----------->
                "BL      sub_FFC69820\n"
                "LDR     R1, =0x5D04\n"
                "LDR     R0, =sub_FFC639D0_my\n"    //----------->
                "STR     R0, [R1,#0x6C]\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
} 

//branch 1

void __attribute__((naked,noinline)) sub_FFC63898_my(){ 
 asm volatile(
                "STMFD   SP!, {R3-R5,LR}\n"
                "BL      sub_FFD1B394\n"
                "LDR     R4, =0x5D04\n"
                "LDR     R0, [R4,#0x30]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC638D0\n"
                "LDR     R1, =0xFFC639B0\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC59164\n"
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x30]\n"
                "STR     R0, [R4,#0x2C]\n"
                "BL      sub_FFC637B0\n"
                "LDMFD   SP!, {R3-R5,PC}\n"
"loc_FFC638D0:\n"
                "BL      sub_FFC166E8\n"
                "LDRH    R0, [R4,#4]\n"
                "SUB     R12, R0, #0x8200\n"
                "SUBS    R12, R12, #0xA\n"
                "BNE     loc_FFC638F4\n"
                "MOV     R0, #0x24\n"
                "BL      sub_FFC67E90\n"
                "MOV     R0, #0x25\n"
                "BL      sub_FFC67E90\n"
"loc_FFC638F4:\n"
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, SP\n"
                "STRH    R0, [SP]\n"
                "LDR     R0, [R4,#0x5C]\n"
                "STRH    R0, [SP,#2]\n"
                "MOV     R0, #0x40\n"
                "BL      sub_FFC67E50\n"
                "LDR     R0, [R4,#0x1C]\n"
                "CMP     R0, #0\n"
                "LDREQH  R0, [R4,#4]\n"
                "BLEQ    sub_FFC5DBA4\n"
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, #1\n"
                "BL      sub_FFC62CBC_my\n" //------------->
                "LDR     R0, [R4,#0x68]\n"
                "BL      sub_FFC64350\n"
                "MOV     R0, #3\n"
                "STR     R0, [R4,#0x68]\n"
                "LDR     R1, [R4,#0x6C]\n"
                "ADD     SP, SP, #4\n"
                "LDMFD   SP!, {R4,R5,LR}\n"
                "MOV     R0, #0\n"
                "BX      R1\n"
 );
} 


//branch 2

void __attribute__((naked,noinline)) sub_FFC639D0_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "LDR     R4, =0x5D04\n"
                "LDRH    R0, [R4,#4]\n"
                "BL      sub_FFD2A2F8\n"
                "BL      sub_FFD27C20\n"
                "BL      sub_FFD2B25C\n"
                "BL      sub_FFD2B854\n"
                "BL      sub_FFD32260\n"
            //  "BL      nullsub_72\n"
                "BL      sub_FFD2AC48\n"
                "MOV     R5, #0\n"
                "MOV     R0, R5\n"
                "STR     R5, [R4,#0x24]\n"
                "BL      sub_FFC167D0\n"
            //  "BL      nullsub_78\n"
                "STR     R5, [R4,#0x3C]\n"
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC62CBC_my\n"  //------------>
                "BL      sub_FFC661D0\n"
                "LDR     R0, [R4,#0x60]\n"
                "CMP     R0, #0\n"
                "STRNE   R5, [R4,#0x60]\n"
                "BLNE    sub_FFC63EA4\n"
                "BL      sub_FFC62150\n"
                "BL      sub_FFD28994\n"
                "LDR     R1, [R4,#0x5C]\n"
                "MOV     R0, #0x41\n"
                "BL      sub_FFC67E50\n"
                "BL      sub_FFC63EA4\n"
                "BL      sub_FFD27BE0\n"
                "BL      sub_FFD23394\n"
                "CMP     R0, #0\n"
                "BLEQ    sub_FFD27C24\n"
                "BL      sub_FFD2A22C\n"
                "BL      sub_FFD1B204\n"
                "BL      sub_FFC5BECC\n"
                "STR     R0, [R4,#0x58]\n"
                "LDR     R0, =0x8003\n"
                "STR     R5, [R4,#0x2C]\n"
                "BL      sub_FFC5DCEC\n"
                "STRH    R0, [R4]\n"
                "LDR     R0, =0x313D\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC5C93C\n"
                "BL      sub_FFC641E8\n"
                "LDR     R0, [R4,#0x30]\n"
                "CMP     R0, #1\n"
                "STREQ   R5, [R4,#0x30]\n"
                "LDMEQFD SP!, {R4-R6,LR}\n"
                "BEQ     sub_FFC637B0\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
 );
} 

//branches are joining here

void __attribute__((naked,noinline)) sub_FFC62CBC_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "MOV     R5, R0\n"
                "MOV     R4, R1\n"
                "LDR     R1, =0xFFC62EB4\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "LDR     R6, =0x5D04\n"
                "LDR     R0, [R6,#0x10]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC62E74\n"
                "LDR     R0, [R6,#0x18]\n"
                "LDR     R1, =0x820A\n"
                "LDR     R2, =0xFFFE0000\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC62D3C\n"
                "CMP     R4, #1\n"
                "LDMEQFD SP!, {R4-R6,PC}\n"
                "CMP     R4, #0\n"
                "BNE     loc_FFC62D3C\n"
                "CMP     R5, R1\n"
                "BNE     loc_FFC62D1C\n"
                "BL      sub_FFC64268\n"
                "BL      sub_FFC63F08\n"
                "B       loc_FFC62E74\n"
"loc_FFC62D1C:\n"
                "CMP     R2, R5,LSL#17\n"
                "TSTNE   R5, #0xC00\n"
                "BEQ     loc_FFC62D30\n"
                "BL      sub_FFC63FB0_my\n"   //----------->
                "B       loc_FFC62D34\n"
"loc_FFC62D30:\n"
                "BL      sub_FFC63F64\n"
"loc_FFC62D34:\n"
                "BL      sub_FFC64268\n"
                "B       loc_FFC62E74\n"
"loc_FFC62D3C:\n"
                "CMP     R5, R1\n"
                "BNE     loc_FFC62D90\n"
                "LDRH    R0, [R6,#2]\n"
                "CMP     R0, R1\n"
                "BEQ     loc_FFC62E6C\n"
                "CMP     R2, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FFC62D74\n"
                "LDR     R1, =0xFFC62ED4\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FFC62E44\n"
                "B       loc_FFC62D88\n"
"loc_FFC62D74:\n"
                "LDR     R1, =0xFFC62EE4\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FFC62E60\n"
"loc_FFC62D88:\n"
                "BL      sub_FFC63F08\n"
                "B       loc_FFC62E6C\n"
"loc_FFC62D90:\n"
                "CMP     R2, R5,LSL#17\n"
                "LDRH    R0, [R6,#2]\n"
                "TSTNE   R5, #0xC00\n"
                "BEQ     loc_FFC62E00\n"
                "CMP     R0, R1\n"
                "BNE     loc_FFC62DC0\n"
                "LDR     R1, =0xFFC62EF4\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FFC62E1C\n"
                "B       loc_FFC62DF8\n"
"loc_FFC62DC0:\n"
                "CMP     R2, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FFC62DE4\n"
                "LDR     R1, =0xFFC62F04\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FFC62E44\n"
                "B       loc_FFC62DF8\n"
"loc_FFC62DE4:\n"
                "LDR     R1, =0xFFC62F14\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "CMP     R4, #1\n"
                "BEQ     loc_FFC62E60\n"
"loc_FFC62DF8:\n"
                "BL      sub_FFC63FB0_my\n"   //------------->
                "B       loc_FFC62E6C\n"
"loc_FFC62E00:\n"
                "CMP     R0, R1\n"
                "BNE     loc_FFC62E24\n"
                "LDR     R1, =0xFFC62F24\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "CMP     R4, #1\n"
                "BNE     loc_FFC62E68\n"
"loc_FFC62E1C:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FFC63F38\n"
"loc_FFC62E24:\n"
                "CMP     R2, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FFC62E4C\n"
                "LDR     R1, =0xFFC62F34\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "CMP     R4, #1\n"
                "BNE     loc_FFC62E68\n"
"loc_FFC62E44:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FFC63FDC\n"
"loc_FFC62E4C:\n"
                "LDR     R1, =0xFFC62F44\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "CMP     R4, #1\n"
                "BNE     loc_FFC62E68\n"
"loc_FFC62E60:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FFC63F8C\n"
"loc_FFC62E68:\n"
                "BL      sub_FFC63F64\n"
"loc_FFC62E6C:\n"
                "CMP     R4, #0\n"
                "LDMNEFD SP!, {R4-R6,PC}\n"
"loc_FFC62E74:\n"
                "STRH    R5, [R6,#2]\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
 );
} 

  
void __attribute__((naked,noinline)) sub_FFC63FB0_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC641C8\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC59164\n"
                "LDR     R0, =0x5D04\n"
                "LDR     R0, [R0,#0x28]\n"
                "CMP     R0, #0\n"
                "BLNE    sub_FFC64AB0\n"
                "LDMFD   SP!, {R4,LR}\n"
                "MOV     R0, #0\n"
                "B       sub_FFC67020_my\n"     //------------->
 );
} 


void __attribute__((naked,noinline)) sub_FFC67020_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R4, =0x5EC0\n"
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x30]\n"
                "LDR     R0, [R4,#8]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC6704C\n"
                "LDR     R0, =sub_FFC66C2C_my\n" //--------->
                "MOV     R1, #0\n"
                "BL      sub_FFC5C140\n"
                "STR     R0, [R4,#8]\n"
"loc_FFC6704C:\n"
                "LDR     R0, [R4,#0xC]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC67068\n"
                "LDR     R0, =0xFFC668CC\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC63C18\n"
                "STR     R0, [R4,#0xC]\n"
"loc_FFC67068:\n"
                "BL      sub_FFC6782C\n"
                "BL      sub_FFC66930\n"
                "BL      sub_FFD32AB8\n"
                "BL      sub_FFD34D84\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFD29684\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC66C2C_my(){ 
 asm volatile(
                "STMFD   SP!, {R3-R11,LR}\n"
                "LDR     R5, =0x5EC0\n"
                "MOV     R4, R1\n"
                "LDR     R2, [R5,#0x2C]\n"
                "ADD     R0, R5, #0\n"
                "LDR     R0, [R0,#0x14]\n"
                "LDR     R9, =0x3007\n"
                "CMP     R2, #0\n"
                "MOV     R1, #0\n"
                "MOV     R11, R3\n"
                "MVN     R8, #0\n"
                "BEQ     loc_FFC66CA4\n"
                "CMP     R4, R9\n"
                "BEQ     loc_FFC66E94\n"
                "CMP     R4, #0x800\n"
                "LDREQ   R2, [R5,#0x38]\n"
                "CMPEQ   R11, R2\n"
                "BNE     loc_FFC66FA4\n"
                "STR     R1, [R5,#0x2C]!\n"
                "CMP     R0, #0\n"
                "STR     R8, [R5,#0xC]\n"
                "BNE     loc_FFC67018\n"
                "BL      sub_FFC1C908\n"
                "CMP     R0, #1\n"
                "BEQ     loc_FFC66C9C\n"
                "BL      sub_FFC1C910\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC67018\n"
"loc_FFC66C9C:\n"
                "BL      sub_FFC66A7C\n"
                "B       loc_FFC67018\n"
"loc_FFC66CA4:\n"
                "CMP     R0, #1\n"
                "SUBEQ   R12, R4, #0x2000\n"
                "SUBEQS  R12, R12, #0x1C\n"
                "BNE     loc_FFC66CC0\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC67328\n"
                "B       loc_FFC67018\n"
"loc_FFC66CC0:\n"
                "BL      sub_FFC72BD8\n"
                "LDR     R10, =0x9A5\n"
                "CMP     R0, #1\n"
                "SUB     R6, R10, #4\n"
                "SUB     R7, R10, #2\n"
                "BNE     loc_FFC66CF4\n"
                "CMP     R4, R10\n"
                "CMPNE   R4, R6\n"
                "CMPNE   R4, R7\n"
                "BNE     loc_FFC66CF4\n"
                "BL      sub_FFC71D7C\n"
                "STR     R4, [R5,#0x3C]\n"
                "B       loc_FFC66FA4\n"
"loc_FFC66CF4:\n"
                "BL      sub_FFD27A40\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC66D14\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC5C67C\n"
                "CMP     R0, #1\n"
                "CMPNE   R4, R10\n"
                "BEQ     loc_FFC66FA4\n"
"loc_FFC66D14:\n"
                "BL      sub_FFC1C9F0\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC66D2C\n"
                "CMP     R4, R6\n"
                "CMPNE   R4, R7\n"
                "BEQ     loc_FFC67018\n"
"loc_FFC66D2C:\n"
                "BL      sub_FFC63DE4\n"
                "LDR     R1, =0x9A2\n"
                "CMP     R0, #1\n"
                "ADD     R2, R1, #2\n"
                "BNE     loc_FFC66D54\n"
                "CMP     R4, R6\n"
                "CMPNE   R4, R1\n"
                "CMPNE   R4, R7\n"
                "CMPNE   R4, R2\n"
                "BEQ     loc_FFC67018\n"
"loc_FFC66D54:\n"
                "LDR     R12, =0x200A\n"
                "CMP     R4, R12\n"
                "BEQ     loc_FFC67008\n"
                "BGT     loc_FFC66DD0\n"
                "LDR     R12, =0x907\n"
                "CMP     R4, R12\n"
                "MOVEQ   R1, #2\n"
                "MOVEQ   R0, R10\n"
                "BEQ     loc_FFC66F44\n"
                "BGT     loc_FFC66DAC\n"
                "SUB     R12, R4, #0x800\n"
                "LDR     R6, =0x2003\n"
                "SUBS    R12, R12, #0x26\n"
                "BEQ     loc_FFC66EA8\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x29\n"
                "BEQ     loc_FFC66EEC\n"
                "CMP     R4, #0x860\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x61\n"
                "BNE     loc_FFC66FBC\n"
                "B       loc_FFC66FA4\n"
"loc_FFC66DAC:\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FFC66F3C\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC67008\n"
                "CMP     R4, R7\n"
                "BEQ     loc_FFC66F3C\n"
                "CMP     R4, R2\n"
                "BEQ     loc_FFC67008\n"
                "B       loc_FFC66FBC\n"
"loc_FFC66DD0:\n"
                "LDR     R12, =0x3149\n"
                "CMP     R4, R12\n"
                "MOVEQ   R1, #0\n"
                "MOVEQ   R0, #0x84\n"
                "BEQ     loc_FFC66FB4\n"
                "BGT     loc_FFC66E28\n"
                "SUB     R12, R4, #0x2000\n"
                "SUBS    R12, R12, #0x20\n"
                "MOVEQ   R1, R11\n"
                "MOVEQ   R0, #0x83\n"
                "BEQ     loc_FFC66FB4\n"
                "CMP     R4, R9\n"
                "BEQ     loc_FFC66E80\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x35\n"
                "BEQ     loc_FFC66E64\n"
                "SUB     R12, R4, #0x3000\n"
                "SUBS    R12, R12, #0x148\n"
                "BNE     loc_FFC66FBC\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x86\n"
                "B       loc_FFC66FB4\n"
"loc_FFC66E28:\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x4A\n"
                "BEQ     loc_FFC66FAC\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #3\n"
                "BEQ     loc_FFC66F68\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #8\n"
                "BEQ     loc_FFC66F4C\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #0xF\n"
                "BNE     loc_FFC66FBC\n"
                "MOV     R0, #0x82\n"
                "BL      sub_FFC67E90\n"
                "B       loc_FFC67018\n"
"loc_FFC66E64:\n"
                "BL      sub_FFC67860\n"
                "CMP     R0, #4\n"
                "BEQ     loc_FFC67008\n"
                "LDR     R0, [R5,#0x1C]\n"
                "CMP     R0, #0\n"
                "BLNE    sub_FFC669C4\n"
                "B       loc_FFC67018\n"
"loc_FFC66E80:\n"
                "MOV     R0, #1\n"
                "STR     R0, [R5,#0x1C]\n"
                "LDR     R0, [R5,#0x18]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC66E9C\n"
"loc_FFC66E94:\n"
                "BL      sub_FFC669C4\n"
                "LDMFD   SP!, {R3-R11,PC}\n"
"loc_FFC66E9C:\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC66B9C\n"
                "B       loc_FFC67018\n"
"loc_FFC66EA8:\n"
                "BL      sub_FFC63DE4\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC66EC0\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC63DD8\n"
                "B       loc_FFC67018\n"
"loc_FFC66EC0:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORR     R0, R0, R1\n"
                "LDR     R1, [R5,#0x1C]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FFC67018\n"
                "MOV     R1, #0\n"
                "MOV     R0, R6\n"
                "BL      sub_FFC4B748\n"
                "BL      sub_FFD56FF0\n"
                "B       loc_FFC67018\n"
"loc_FFC66EEC:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FFC67018\n"
                "BL      sub_FFC63DF0\n"
                "CMP     R0, #0\n"
                "LDREQ   R0, [R5,#0x1C]\n"
                "CMPEQ   R0, #0\n"
                "BNE     loc_FFC67018\n"
                "BL      sub_FFC63DE4\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC67018\n"
                "BL      sub_FFD34E2C\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC67018\n"
                "MOV     R1, #0\n"
                "MOV     R0, R6\n"
                "BL      sub_FFC4B748\n"
                "BL      sub_FFD1C0D0\n"
                "B       loc_FFC67018\n"
"loc_FFC66F3C:\n"
                "MOV     R1, #1\n"
                "MOV     R0, R4\n"
"loc_FFC66F44:\n"
                "BL      sub_FFC66AD8_my\n"   //------------->
                "LDMFD   SP!, {R3-R11,PC}\n"
"loc_FFC66F4C:\n"
                "MOV     R0, R11\n"
                "BL      sub_FFC626F4\n"
                "CMP     R0, #0\n"
                "MOVEQ   R1, R11\n"
                "MOVEQ   R0, R4\n"
                "BLEQ    sub_FFC674CC_my\n"  //-------------->
                "B       loc_FFC66FA4\n"
"loc_FFC66F68:\n"
                "LDR     R0, [R5,#0x3C]\n"
                "CMN     R0, #1\n"
                "BEQ     loc_FFC66FA4\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC70E14\n"
                "LDR     R0, [R5,#0x3C]\n"
                "CMP     R0, R6\n"
                "BNE     loc_FFC66F94\n"
                "BL      sub_FFC1C908\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC66FA0\n"
"loc_FFC66F94:\n"
                "LDR     R0, [R5,#0x3C]\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC5C8F0\n"
"loc_FFC66FA0:\n"
                "STR     R8, [R5,#0x3C]\n"
"loc_FFC66FA4:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R3-R11,PC}\n"
"loc_FFC66FAC:\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x85\n"
"loc_FFC66FB4:\n"
                "BL      sub_FFC67E50\n"
                "B       loc_FFC67018\n"
"loc_FFC66FBC:\n"
                "LDR     R12, =0x855\n"
                "CMP     R4, R12\n"
                "BEQ     loc_FFC66FF8\n"
                "BGT     loc_FFC66FE4\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x38\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x39\n"
                "BNE     loc_FFC67008\n"
                "B       loc_FFC66FF8\n"
"loc_FFC66FE4:\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x56\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x5D\n"
                "BNE     loc_FFC67008\n"
"loc_FFC66FF8:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FFC67018\n"
"loc_FFC67008:\n"
                "MOV     R1, R11\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC674CC_my\n"    //--------------->
                "LDMFD   SP!, {R3-R11,PC}\n"
"loc_FFC67018:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R3-R11,PC}\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC66AD8_my(){
asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "MOV     R4, R0\n"
                "LDR     R0, =0x5EC0\n"
                "MOV     R5, R1\n"
                "LDR     R0, [R0,#0x1C]\n"
                "CMP     R0, #0\n"
                "LDRNE   R1, =0xFFC66C08\n"
                "BNE     loc_FFC66B84\n"
                "BL      sub_FFC6786C\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC66B14\n"
"loc_FFC66B04:\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "MOV     R1, #0\n"
                "B       sub_FFC674CC_my\n" //----------->
"loc_FFC66B14:\n"
                "CMP     R5, #2\n"
                "BNE     loc_FFC66B2C\n"
                "BL      sub_FFC661D0\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC66B74\n"
                "B       loc_FFC66B40\n"
"loc_FFC66B2C:\n"
                "CMP     R5, #1\n"
                "BNE     loc_FFC66B74\n"
                "BL      sub_FFC661E8\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC66B74\n"
"loc_FFC66B40:\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC70E14\n"
                "SUB     R12, R4, #0x900\n"
                "SUBS    R12, R12, #0xA1\n"
                "SUBNE   R12, R4, #0x900\n"
                "SUBNES  R12, R12, #0xA3\n"
                "SUBNE   R12, R4, #0x900\n"
                "SUBNES  R12, R12, #0xA5\n"
                "LDREQ   R0, =0xC507\n"
                "MOVEQ   R1, #0\n"
                "BLEQ    sub_FFC4B748\n"
"loc_FFC66B6C:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
"loc_FFC66B74:\n"
                "BL      sub_FFC66A7C\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC66B90\n"
                "LDR     R1, =0xFFC66C18\n"
"loc_FFC66B84:\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "B       loc_FFC66B6C\n"
"loc_FFC66B90:\n"
                "MOV     R0, R5\n"
                "BL      sub_FFD26974\n"
                "B       loc_FFC66B04\n"
 );
}

void __attribute__((naked,noinline)) sub_FFC674CC_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "MOV     R7, R1\n"
                "MOV     R4, R0\n"
                "BL      sub_FFC678E8\n"
                "LDR     R5, =0x5F04\n"
                "LDR     R3, =0x200A\n"
                "LDR     R12, [R5]\n"
                "LDR     R2, =0x4008\n"
                "LDR     R6, =0x9A3\n"
                "LDR     R0, =0x3007\n"
                "LDR     R1, =0x1051\n"
                "CMP     R12, #9\n"
                "ADD     LR, R3, #0x15\n"
                "ADDLS   PC, PC, R12,LSL#2\n"
                "B       loc_FFC67824\n"
"loc_FFC67508:\n"
                "B       loc_FFC67530\n"
"loc_FFC6750C:\n"
                "B       loc_FFC67540\n"
"loc_FFC67510:\n"
                "B       loc_FFC67550\n"
"loc_FFC67514:\n"
                "B       loc_FFC675C4\n"
"loc_FFC67518:\n"
                "B       loc_FFC67604\n"
"loc_FFC6751C:\n"
                "B       loc_FFC6768C\n"
"loc_FFC67520:\n"
                "B       loc_FFC676BC\n"
"loc_FFC67524:\n"
                "B       loc_FFC6776C\n"
"loc_FFC67528:\n"
                "B       loc_FFC676CC\n"
"loc_FFC6752C:\n"
                "B       loc_FFC67794\n"
"loc_FFC67530:\n"
                "MOV     R1, R7\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R8,LR}\n"
                "B       sub_FFC67454\n"
"loc_FFC67540:\n"
                "MOV     R1, R7\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R8,LR}\n"
                "B       sub_FFC67A64_my\n"  //----------->
"loc_FFC67550:\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC675B4\n"
                "SUB     R12, R4, #0x2000\n"
                "SUBS    R12, R12, #6\n"
                "BEQ     loc_FFC67578\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC675BC\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x4B\n"
                "BNE     loc_FFC67824\n"
"loc_FFC67578:\n"
                "BL      sub_FFC66A58\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC678D0\n"
                "LDR     R0, [R5,#8]\n"
                "CMP     R0, #0\n"
                "MOVNE   R1, #0\n"
                "MOVNE   R0, R6\n"
                "BNE     loc_FFC675AC\n"
                "LDR     R0, [R5,#4]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC677D4\n"
                "LDR     R0, =0x9A1\n"
                "MOV     R1, #0\n"
"loc_FFC675AC:\n"
                "BL      sub_FFC67454\n"
                "B       loc_FFC677D4\n"
"loc_FFC675B4:\n"
                "BL      sub_FFC679D8\n"
                "B       loc_FFC677D4\n"
"loc_FFC675BC:\n"
                "BL      sub_FFC679F0\n"
                "B       loc_FFC677D4\n"
"loc_FFC675C4:\n"
                "SUB     R12, R4, #0x900\n"
                "SUBS    R12, R12, #0xA2\n"
                "BEQ     loc_FFC675F4\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FFC675EC\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC675FC\n"
                "CMP     R4, R0\n"
                "BLEQ    sub_FFC679F0\n"
                "B       loc_FFC67824\n"
"loc_FFC675EC:\n"
                "BL      sub_FFC673F8_my\n"    //--------------->
                "B       loc_FFC67824\n"
"loc_FFC675F4:\n"
                "BL      sub_FFC679B8\n"
                "B       loc_FFC67824\n"
"loc_FFC675FC:\n"
                "BL      sub_FFC679D8\n"
                "B       loc_FFC67824\n"
"loc_FFC67604:\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC67660\n"
                "BGT     loc_FFC6762C\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FFC67648\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC67678\n"
"loc_FFC67620:\n"
                "CMP     R4, R3\n"
                "BNE     loc_FFC67824\n"
                "B       loc_FFC6763C\n"
"loc_FFC6762C:\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC6766C\n"
"loc_FFC67634:\n"
                "CMP     R4, R2\n"
                "BNE     loc_FFC67824\n"
"loc_FFC6763C:\n"
                "BL      sub_FFC67A40\n"
                "BL      sub_FFC679B8\n"
                "B       loc_FFC677D4\n"
"loc_FFC67648:\n"
                "BL      sub_FFC18614\n"
                "MOV     R0, #5\n"
                "BL      sub_FFC678D0\n"
                "MOV     R0, #0\n"
                "STR     R0, [R5,#0xC]\n"
                "B       loc_FFC677D4\n"
"loc_FFC67660:\n"
                "MOV     R0, #5\n"
                "BL      sub_FFC678D0\n"
                "B       loc_FFC676B0\n"
"loc_FFC6766C:\n"
                "BL      sub_FFC18614\n"
                "BL      sub_FFC67A40\n"
                "B       loc_FFC67764\n"
"loc_FFC67678:\n"
                "BL      sub_FFC18614\n"
                "BL      sub_FFC67A40\n"
                "B       loc_FFC676C4\n"
"loc_FFC67684:\n"
                "BL      sub_FFC678D0\n"
                "B       loc_FFC677D4\n"
"loc_FFC6768C:\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC676B0\n"
                "BGT     loc_FFC676A4\n"
                "CMP     R4, R1\n"
                "BNE     loc_FFC67620\n"
                "B       loc_FFC676C4\n"
"loc_FFC676A4:\n"
                "CMP     R4, R0\n"
                "BNE     loc_FFC67634\n"
                "B       loc_FFC67764\n"
"loc_FFC676B0:\n"
                "MOV     R0, R7\n"
                "BL      sub_FFC67A0C\n"
                "B       loc_FFC677D4\n"
"loc_FFC676BC:\n"
                "CMP     R4, R1\n"
                "BNE     loc_FFC67824\n"
"loc_FFC676C4:\n"
                "MOV     R0, #8\n"
                "B       loc_FFC67684\n"
"loc_FFC676CC:\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC67764\n"
                "BGT     loc_FFC67750\n"
                "CMP     R4, R3\n"
                "BEQ     loc_FFC675B4\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC676B0\n"
                "B       loc_FFC67824\n"
"loc_FFC67750:\n"
                "CMP     R4, R2\n"
                "SUBNE   R12, R4, #0x4000\n"
                "SUBNES  R12, R12, #0xE\n"
                "BEQ     loc_FFC675B4\n"
                "B       loc_FFC67824\n"
"loc_FFC67764:\n"
                "MOV     R0, #7\n"
                "B       loc_FFC67684\n"
"loc_FFC6776C:\n"
                "CMP     R4, R3\n"
                "BEQ     loc_FFC67784\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC676B0\n"
                "CMP     R4, R2\n"
                "BNE     loc_FFC67824\n"
"loc_FFC67784:\n"
                "BL      sub_FFC679B8\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC66B9C\n"
                "B       loc_FFC677D4\n"
"loc_FFC67794:\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x4A\n"
                "BEQ     loc_FFC677DC\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC67814\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC67804\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x2A\n"
                "BNE     loc_FFC67824\n"
                "BL      sub_FFC67970\n"
                "LDR     R0, [R5,#0x14]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC677D4\n"
                "BL      sub_FFC6798C_my\n"  //--------------->
                "BL      sub_FFD27A4C\n"
"loc_FFC677D4:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FFC677DC:\n"
                "BL      sub_FFC67970\n"
                "LDR     R0, =0x8007\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC5DCE0\n"
                "BL      sub_FFD26928\n"
                "BL      sub_FFC679B8\n"
                "BL      sub_FFD27A4C\n"
                "BL      sub_FFC66A58\n"
                "MOV     R0, #0\n"
                "B       loc_FFC67684\n"
"loc_FFC67804:\n"
                "BL      sub_FFC67970\n"
                "BL      sub_FFD26928\n"
                "BL      sub_FFD27A4C\n"
                "B       loc_FFC675BC\n"
"loc_FFC67814:\n"
                "BL      sub_FFC67970\n"
                "BL      sub_FFD26928\n"
                "BL      sub_FFD27A4C\n"
                "B       loc_FFC675B4\n"
"loc_FFC67824:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
                ".LTORG\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC67A64_my(){ 
 asm volatile(
                "LDR     R3, =0x5F04\n"
                "LDR     R12, =0x2006\n"
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, [R3,#0xC]\n"
                "LDR     R2, [R3,#0x14]\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC67AD8\n"
                "BGT     loc_FFC67AA4\n"
                "SUB     R12, R0, #0x900\n"
                "SUBS    R12, R12, #0xA2\n"
                "BEQ     loc_FFC67AFC\n"
                "SUB     R12, R0, #0x1000\n"
                "SUBS    R12, R12, #0x51\n"
                "BNE     loc_FFC67B20\n"
                "BL      sub_FFC679D8\n"
                "B       loc_FFC67B18\n"
"loc_FFC67AA4:\n"
                "SUB     R12, R0, #0x3000\n"
                "SUBS    R12, R12, #7\n"
                "BEQ     loc_FFC67B14\n"
                "SUB     R12, R0, #0x3100\n"
                "SUBS    R12, R12, #0x4B\n"
                "BNE     loc_FFC67B20\n"
                "CMP     R2, #0\n"
                "BNE     loc_FFC67B18\n"
                "LDR     R0, [R3,#8]\n"
                "ORRS    R0, R0, R1\n"
                "BEQ     loc_FFC67AE4\n"
                "BL      sub_FFC673F8_my\n"   //-------------->
                "B       loc_FFC67B18\n"
"loc_FFC67AD8:\n"
                "CMP     R2, #0\n"
                "BLEQ    sub_FFC66208\n"
                "B       loc_FFC67B18\n"
"loc_FFC67AE4:\n"
                "LDR     R0, [R3,#4]\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, #3\n"
                "BNE     loc_FFC67B0C\n"
                "BL      sub_FFC679B8\n"
                "B       loc_FFC67B18\n"
"loc_FFC67AFC:\n"
                "CMP     R1, #0\n"
                "BNE     loc_FFC67B18\n"
                "BL      sub_FFC181B8\n"
                "MOV     R0, #2\n"
"loc_FFC67B0C:\n"
                "BL      sub_FFC678D0\n"
                "B       loc_FFC67B18\n"
"loc_FFC67B14:\n"
                "BL      sub_FFC679F0\n"
"loc_FFC67B18:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4,PC}\n"
"loc_FFC67B20:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC673F8_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC676EC\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "LDR     R4, =0x5F04\n"
                "LDR     R0, [R4,#0x10]\n"
                "CMP     R0, #0\n"
                "LDMEQFD SP!, {R4,LR}\n"
                "BEQ     sub_FFC6798C_my\n"    //-------------->
                "LDR     R1, =0xFFC67708\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "BL      sub_FFD27A78\n"
                "LDR     R0, [R4,#0x18]\n"
                "CMP     R0, #1\n"
                "MOVNE   R0, #1\n"
                "STRNE   R0, [R4,#0x18]\n"
                "BLNE    sub_FFC5D20C\n"
                "MOV     R0, #9\n"
                "BL      sub_FFC678D0\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFD267E4\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC6798C_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC67B40\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC59164\n"
                "LDR     R1, =0x5F04\n"
                "MOV     R0, #0\n"
                "STR     R0, [R1,#0xC]\n"
                "MOV     R0, #4\n"
                "BL      sub_FFC678D0\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC670C0_my\n"  //------------->
 );
} 


void __attribute__((naked,noinline)) sub_FFC670C0_my(){ 
 asm volatile(
                "LDR     R0, =0x5EC0\n"
                "STMFD   SP!, {R3,LR}\n"
                "LDR     R1, [R0,#0x40]\n"
                "CMP     R1, #1\n"
                "MOVNE   R1, #1\n"
                "STRNE   R1, [R0,#0x40]\n"
                "BLNE    sub_FFC5D20C\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x80\n"
                "BL      sub_FFC67E50\n"
                "MOV     R2, #2\n"
                "MOV     R1, SP\n"
                "MOV     R0, #0x6B\n"
                "BL      sub_FFC5AECC\n"
                "MOV     R2, #2\n"
                "MOV     R1, SP\n"
                "MOV     R0, #0xA3\n"
                "BL      sub_FFC5ADC4\n"
                "BL      sub_FFC4B834\n"
                "BL      sub_FFC663E8\n"
                "BL      sub_FFC185DC_my\n"  //------------------>
                "BL      sub_FFC66A10\n"
                "LDMFD   SP!, {R12,PC}\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC185DC_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "MOV     R4, R0\n"
                "MOV     R0, #0x20\n"
                "LDR     R1, =0xFFC18708\n"
                "BL      sub_FFC59164\n"
                "BL      sub_FFC18B68\n"
                "CMP     R0, #0\n"
                "LDMNEFD SP!, {R4,PC}\n"
                "MOV     R0, #4\n"
                "BL      sub_FFC48FB4\n"
                "BL      sub_FFC4CB24\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC4EC98_my\n" //-------------->
 );
} 


void __attribute__((naked,noinline)) sub_FFC4EC98_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "MOV     R8, R0\n"
                "MOV     R0, #0x41\n"
                "SUB     SP, SP, #0x38\n"
                "MOV     R5, #0\n"
                "STR     R0, [SP,#0x34]\n"
                "BL      sub_FFC4EC68\n"
                "CMP     R0, #0\n"
                "LDRNE   R1, =0x13B\n"
                "BNE     loc_FFC4EE44\n"
                "LDR     R4, =0x5698\n"
                "MOV     R1, #0x1E\n"
                "LDR     R0, [R4,#0xC]\n"
                "BL      sub_FFC18FE0\n"
                "BL      sub_FFC5B05C\n"
                "STR     R0, [R4,#4]\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC571AC\n"
                "STR     R0, [SP,#0x28]\n"
                "ADD     R0, SP, #0x28\n"
                "MOV     R1, SP\n"
                "BL      sub_FFC572F8\n"
                "MOV     R0, SP\n"
                "BL      sub_FFC571E0\n"
                "STR     R0, [SP,#0x2C]\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x2C\n"
                "MOV     R1, #0x34\n"
                "BL      sub_FFC5B37C\n"
                "LDR     R7, [SP,#0x2C]\n"
                "BL      sub_FFC4F1C0\n"
                "MOV     R6, #0\n"
                "ADD     R1, SP, #0x28\n"
                "ADD     R0, SP, #0x2C\n"
                "STR     R6, [SP,#0x2C]\n"
                "STR     R6, [SP,#0x28]\n"
                "BL      sub_FFC21E44\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x2C\n"
                "MOV     R1, #0x2F\n"
                "BL      sub_FFC5B37C\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x28\n"
                "MOV     R1, #0x2D\n"
                "BL      sub_FFC5B37C\n"
                "ADD     R1, SP, #0x28\n"
                "ADD     R0, SP, #0x2C\n"
                "BL      sub_FFC255A4\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x2C\n"
                "MOV     R1, #0x30\n"
                "BL      sub_FFC5B37C\n"
                "ADD     R1, SP, #0x28\n"
                "ADD     R0, SP, #0x2C\n"
                "BL      sub_FFC22608\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x28\n"
                "MOV     R1, #0x2E\n"
                "BL      sub_FFC5B37C\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x2C\n"
                "MOV     R1, #0xB8\n"
                "BL      sub_FFC5B428\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x11D\n"
                "LDRNE   R0, =0xFFC4F0BC\n"
                "BLNE    sub_FFC0BFC8\n"
                "LDRH    R0, [SP,#0x2C]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x28\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, #1\n"
                "STR     R0, [SP,#0x28]\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R1, #0x92\n"
                "BL      sub_FFC5B37C\n"
                "MOV     R2, #1\n"
                "ADD     R1, SP, #0x34\n"
                "MOV     R0, #0xFA\n"
                "BL      sub_FFC5AECC\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x152\n"
                "LDRNE   R0, =0xFFC4F0BC\n"
                "BLNE    sub_FFC0BFC8\n"
                "LDRB    R0, [SP,#0x34]\n"
                "MOV     R3, R8\n"
                "MOV     R2, #0x14\n"
                "AND     R1, R0, #0xFF\n"
                "ADD     R0, SP, #0x30\n"
                "STR     R7, [SP]\n"
                "BL      sub_FFCEA0E8\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x156\n"
                "BNE     loc_FFC4EE44\n"
                "LDR     R0, =0x1CD94\n"
                "LDR     R1, [SP,#0x30]\n"
                "MOV     R2, #0x10\n"
                "BL      sub_FFCE05AC\n"
                "TST     R0, #1\n"
                "BEQ     loc_FFC4EE54\n"
                "LDR     R1, =0x15E\n"
"loc_FFC4EE44:\n"
                "LDR     R0, =0xFFC4F0BC\n"
                "BL      sub_FFC0BFC8\n"
"loc_FFC4EE4C:\n"
                "ADD     SP, SP, #0x38\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FFC4EE54:\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x30\n"
                "MOV     R1, #0x2B\n"
                "BL      sub_FFC5B37C\n"
                "BL      sub_FFC69178\n"
                "LDRSB   R1, [SP,#0x34]\n"
                "CMP     R0, R1\n"
                "MOVEQ   R7, #0\n"
                "BEQ     loc_FFC4EEA8\n"
                "LDR     R5, =0x1CD94\n"
                "MOV     R0, R5\n"
                "BL      sub_FFC692F4\n"
                "MOV     R8, R0\n"
                "BL      sub_FFC97E4C\n"
                "CMP     R8, R0\n"
                "MOV     R7, R0\n"
                "LDRLS   R1, =0x16B\n"
                "LDRLS   R0, =0xFFC4F0BC\n"
                "BLLS    sub_FFC0BFC8\n"
                "SUB     R7, R8, R7\n"
"loc_FFC4EEA8:\n"
                "BL      taskcreate_MovieRecord_my\n"  //--------------->
                "LDR     R0, =0x1CDB8\n"
                "LDRH    R3, [R0,#0x4E]\n"
                "LDRH    R2, [R0,#0x4C]\n"
                "LDR     R1, [R0,#0x48]\n"
                "LDR     R0, [R0,#0x44]\n"
                "BL      sub_FFC49AB4\n"
                "MOV     R3, #0\n"
                "LDR     R2, =0xFFC4EC30\n"
                "MOV     R1, #0\n"
                "LDR     R0, =0xFFC4EC44\n"
                "ADD     R8, SP, #0xC\n"
                "STMIA   R8, {R0-R3}\n"
                "LDR     R2, =0xFFC4EC54\n"
                "LDR     R1, =0xFFC4EC40\n"
                "STMEA   SP, {R1-R3}\n"
                "LDR     R1, [R4,#4]\n"
                "MOV     R3, R6\n"
                "MOV     R2, R7\n"
                "MOV     R0, R5\n"
                "BL      sub_FFC49E30\n"
                "LDR     R0, [R4,#0xC]\n"
                "MOV     R1, #0x20\n"
                "BL      sub_FFC18FAC\n"
                "B       loc_FFC4EE4C\n"
 );
} 


void __attribute__((naked,noinline)) taskcreate_MovieRecord_my(){ 
 asm volatile(
                "STMFD   SP!, {R3-R9,LR}\n"
                "LDR     R5, =0x5518\n"
                "MOV     R6, #0\n"
                "STR     R6, [R5,#0x20]\n"
                "LDR     R0, [R5,#4]\n"
                "LDR     R8, =0x2710\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC4ABF8\n"
                "MOV     R0, #1\n"
                "STR     R0, [R5,#4]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC0BE44\n"
                "STR     R0, [R5,#0x10]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC0BE44\n"
                "STR     R0, [R5,#0x14]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0xA\n"
                "BL      sub_FFC0BDFC\n"
                "STR     R0, [R5,#0x18]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0xA\n"
                "BL      sub_FFC0BDFC\n"
                "LDR     R7, =0x1C8DC\n"
                "MOV     R4, #9\n"
                "ADD     R9, R4, #0x2D4\n"
                "STR     R0, [R5,#0x1C]\n"
"loc_FFC4ABB4:\n"
                "RSB     R0, R4, R4,LSL#3\n"
                "STR     R6, [R7,R0,LSL#2]\n"
                "ADD     R1, R7, R0,LSL#2\n"
                "STR     R9, [SP]\n"
                "LDR     R0, [R5,#0x1C]\n"
                "LDR     R3, =0xFFC49DD0\n"
                "MOV     R2, R8\n"
                "BL      sub_FFC0BF08\n"
                "SUBS    R4, R4, #1\n"
                "BPL     loc_FFC4ABB4\n"
                "MOV     R3, #0\n"
                "STR     R3, [SP]\n"
                "LDR     R3, =MovieRecordTask_my\n"  //------------>
                "MOV     R2, #0x1000\n"
                "MOV     R1, #0x14\n"
                "LDR     R0, =0xFFC4AD44\n"
                "BL      sub_FFC0BDC8\n"
"loc_FFC4ABF8:\n"
                "BL      sub_FFD0B9A4\n"
                "BL      sub_FFC4AC5C\n"
                "MOV     R1, R0\n"
                "MOV     R0, #0xB\n"
                "ADD     R3, R0, #0x2DC\n"
                "STR     R0, [R1]\n"
                "STR     R3, [SP]\n"
                "LDR     R0, [R5,#0x18]\n"
                "LDR     R3, =0xFFC49DD0\n"
                "MOV     R2, R8\n"
                "BL      sub_FFC0BF08\n"
                "LDMFD   SP!, {R3-R9,PC}\n"
 );
} 


void __attribute__((naked,noinline)) MovieRecordTask_my(){ 
 asm volatile(
                "STMFD   SP!, {R2-R8,LR}\n"
                "LDR     R8, =0x32B\n"
                "LDR     R7, =0x2710\n"
                "LDR     R4, =0x5518\n"
                "MOV     R6, #0\n"
                "MOV     R5, #1\n"
"loc_FFC4AA50:\n"
                "LDR     R0, [R4,#0x18]\n"
                "MOV     R2, #0\n"
                "ADD     R1, SP, #4\n"
                "BL      sub_FFC19230\n"
                "LDR     R0, [R4,#0x20]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC4AB20\n"
                "LDR     R0, [SP,#4]\n"
                "LDR     R1, [R0]\n"
                "SUB     R1, R1, #2\n"
                "CMP     R1, #9\n"
                "ADDLS   PC, PC, R1,LSL#2\n"
                "B       loc_FFC4AB20\n"
"loc_FFC4AA84:\n"
                "B       loc_FFC4AAD4\n"
"loc_FFC4AA88:\n"
                "B       loc_FFC4AAF4\n"
"loc_FFC4AA8C:\n"
                "B       loc_FFC4AB04\n"
"loc_FFC4AA90:\n"
                "B       loc_FFC4AB0C\n"
"loc_FFC4AA94:\n"
                "B       loc_FFC4AADC\n"
"loc_FFC4AA98:\n"
                "B       loc_FFC4AB14\n"
"loc_FFC4AA9C:\n"
                "B       loc_FFC4AAE4\n"
"loc_FFC4AAA0:\n"
                "B       loc_FFC4AB20\n"
"loc_FFC4AAA4:\n"
                "B       loc_FFC4AB1C\n"
"loc_FFC4AAA8:\n"
                "B       loc_FFC4AAAC\n"
"loc_FFC4AAAC:\n"
                "STR     R6, [R4,#0x34]\n"
                "LDR     R0, =0xFFC4A720\n"
                "LDR     R2, =0xFFC49FDC\n"
                "LDR     R1, =0x1CA04\n"
                "STR     R0, [R4,#0xA0]\n"
                "LDR     R0, =0xFFC4A0C0\n"
                "STR     R6, [R4,#0x24]\n"
                "BL      sub_FFC2C3C4\n"
                "STR     R5, [R4,#0x38]\n"
                "B       loc_FFC4AB20\n"
"loc_FFC4AAD4:\n"
                "BL      unlock_optical_zoom\n"     //  +
                "BL      sub_FFC4A818\n"
                "B       loc_FFC4AB20\n"
"loc_FFC4AADC:\n"
                "BL      sub_FFC4A4F4_my\n"  //--------------->
                "B       loc_FFC4AB20\n"
"loc_FFC4AAE4:\n"
                "LDR     R1, [R0,#0x10]\n"
                "LDR     R0, [R0,#4]\n"
                "BL      sub_FFD0C5E0\n"
                "B       loc_FFC4AB20\n"
"loc_FFC4AAF4:\n"
                "LDR     R0, [R4,#0x38]\n"
                "CMP     R0, #5\n"
                "STRNE   R5, [R4,#0x28]\n"
                "B       loc_FFC4AB20\n"
"loc_FFC4AB04:\n"
                "BL      sub_FFC4A288\n"
                "B       loc_FFC4AB20\n"
"loc_FFC4AB0C:\n"
                "BL      sub_FFC4A10C\n"
                "B       loc_FFC4AB20\n"
"loc_FFC4AB14:\n"
                "BL      sub_FFC49F68\n"
                "B       loc_FFC4AB20\n"
"loc_FFC4AB1C:\n"
                "BL      sub_FFC4AC88\n"
"loc_FFC4AB20:\n"
                "LDR     R1, [SP,#4]\n"
                "STR     R6, [R1]\n"
                "LDR     R3, =0xFFC49DD0\n"
                "MOV     R2, R7\n"
                "STR     R8, [SP]\n"
                "LDR     R0, [R4,#0x1C]\n"
                "BL      sub_FFC0BF08\n"
                "B       loc_FFC4AA50\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC4A4F4_my(){ 
 asm volatile(                                   	
                "STMFD   SP!, {R4-R8,LR}\n"
                "SUB     SP, SP, #0x40\n"
                "MOV     R6, #0\n"
                "LDR     R5, =0x5518\n"
                "MOV     R4, R0\n"
                "STR     R6, [SP,#0x30]\n"
                "STR     R6, [SP,#0x28]\n"
                "LDR     R0, [R5,#0x38]\n"
                "MOV     R8, #4\n"
                "CMP     R0, #3\n"
                "STREQ   R8, [R5,#0x38]\n"
                "LDR     R0, [R5,#0xA0]\n"
            //  "BLX     R0\n"
                ".long   0xE12FFF30\n"
                "LDR     R0, [R5,#0x38]\n"
                "CMP     R0, #4\n"
                "BNE     loc_FFC4A5CC\n"
                "ADD     R3, SP, #0x28\n"
                "ADD     R2, SP, #0x2C\n"
                "ADD     R1, SP, #0x30\n"
                "ADD     R0, SP, #0x34\n"
                "BL      sub_FFD0C774\n"
                "CMP     R0, #0\n"
                "MOV     R7, #1\n"
                "BNE     loc_FFC4A570\n"
                "LDR     R1, [R5,#0x28]\n"
                "CMP     R1, #1\n"
                "BNE     loc_FFC4A5D4\n"
                "LDR     R1, [R5,#0x50]\n"
                "LDR     R2, [R5,#0x3C]\n"
                "CMP     R1, R2\n"
                "BCC     loc_FFC4A5D4\n"
"loc_FFC4A570:\n"
                "CMP     R0, #0x80000001\n"
                "STREQ   R8, [R5,#0x54]\n"
                "BEQ     loc_FFC4A5A8\n"
                "CMP     R0, #0x80000003\n"
                "STREQ   R7, [R5,#0x54]\n"
                "BEQ     loc_FFC4A5A8\n"
                "CMP     R0, #0x80000005\n"
                "MOVEQ   R0, #2\n"
                "BEQ     loc_FFC4A5A4\n"
                "CMP     R0, #0x80000007\n"
                "STRNE   R6, [R5,#0x54]\n"
                "BNE     loc_FFC4A5A8\n"
                "MOV     R0, #3\n"
"loc_FFC4A5A4:\n"
                "STR     R0, [R5,#0x54]\n"
"loc_FFC4A5A8:\n"
                "LDR     R0, =0x1CA34\n"
                "LDR     R0, [R0,#8]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC4A5C0\n"
                "BL      sub_FFC38C10\n"
                "B       loc_FFC4A5C4\n"
"loc_FFC4A5C0:\n"
                "BL      sub_FFC49F68\n"
"loc_FFC4A5C4:\n"
                "MOV     R0, #5\n"
                "STR     R0, [R5,#0x38]\n"
"loc_FFC4A5CC:\n"
                "ADD     SP, SP, #0x40\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FFC4A5D4:\n"
                "LDR     LR, [SP,#0x30]\n"
                "CMP     LR, #0\n"
                "BEQ     loc_FFC4A6C8\n"
                "STR     R7, [R5,#0x2C]\n"
                "LDR     R0, [R5,#0x44]\n"
                "CMP     R0, #4\n"
                "LDRNE   R12, [R4,#0xC]\n"
                "BNE     loc_FFC4A614\n"
                "LDR     R0, [R4,#0xC]\n"
                "LDR     R1, [R4,#8]\n"
                "MOV     R2, R0,LSR#3\n"
                "MUL     R1, R2, R1\n"
                "LDR     R2, [R4,#4]\n"
                "SUB     R12, R0, R0,LSR#2\n"
                "ADD     R1, R2, R1,LSL#1\n"
                "STR     R1, [R4,#4]\n"
"loc_FFC4A614:\n"
                "LDR     R0, [R5,#0x6C]\n"
                "LDR     R1, [R4,#0x14]\n"
                "LDR     R2, [R4,#0x18]\n"
                "ADD     R3, SP, #0x38\n"
                "ADD     R8, SP, #0x14\n"
                "STMIA   R8, {R0-R3}\n"
                "LDR     R3, [R5,#0x58]\n"
                "ADD     R2, SP, #0x3C\n"
                "ADD     R8, SP, #8\n"
           //   "LDRD    R0, [SP,#0x28]\n"
                ".long   0xE1CD02D8\n"
                "STMIA   R8, {R0,R2,R3}\n"
                "STR     R1, [SP,#4]\n"
                "STR     LR, [SP]\n"
                "LDMIB   R4, {R0,R1}\n"
                "LDR     R3, [SP,#0x34]\n"
                "MOV     R2, R12\n"
                "BL      sub_FFCD0954\n"
                "LDR     R0, [R5,#0x10]\n"
                "MOV     R1, #0x3E8\n"
                "BL      sub_FFC0B98C\n"
                "CMP     R0, #9\n"
                "BNE     loc_FFC4A67C\n"
                "BL      sub_FFD0CD50\n"
                "MOV     R0, #0x90000\n"
                "STR     R7, [R5,#0x38]\n"
                "B       loc_FFC4A694\n"
"loc_FFC4A67C:\n"
                "LDR     R0, [SP,#0x38]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC4A69C\n"
                "BL      sub_FFD0CD50\n"
                "MOV     R0, #0xA0000\n"
                "STR     R7, [R5,#0x38]\n"
"loc_FFC4A694:\n"
                "BL      sub_FFC5D498\n"
                "B       loc_FFC4A5CC\n"
"loc_FFC4A69C:\n"
                "BL      sub_FFCD0A18\n"
                "LDR     R0, [SP,#0x34]\n"
                "LDR     R1, [SP,#0x3C]\n"
                "BL      sub_FFD0CAF8\n"
                "LDR     R0, [R5,#0x4C]\n"
                "LDR     R1, =0x5584\n"
                "ADD     R0, R0, #1\n"
                "STR     R0, [R5,#0x4C]\n"
                "LDR     R0, [SP,#0x3C]\n"
                "MOV     R2, #0\n"
                "BL      sub_FFD0A918_my\n"  //------------>
"loc_FFC4A6C8:\n"
                "LDR     R0, [R5,#0x50]\n"
                "ADD     R0, R0, #1\n"
                "STR     R0, [R5,#0x50]\n"
                "LDR     R1, [R5,#0x78]\n"
                "MUL     R0, R1, R0\n"
                "LDR     R1, [R5,#0x74]\n"
                "BL      sub_FFE4C034\n"
                "MOV     R4, R0\n"
                "BL      sub_FFD0CD88\n"
                "LDR     R1, [R5,#0x70]\n"
                "CMP     R1, R4\n"
                "BNE     loc_FFC4A704\n"
                "LDR     R0, [R5,#0x30]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC4A718\n"
"loc_FFC4A704:\n"
                "LDR     R1, [R5,#0x84]\n"
                "MOV     R0, R4\n"
             // "BLX     R1\n"
                ".long   0xE12FFF31\n"
                "STR     R4, [R5,#0x70]\n"
                "STR     R6, [R5,#0x30]\n"
"loc_FFC4A718:\n"
                "STR     R6, [R5,#0x2C]\n"
                "B       loc_FFC4A5CC\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFD0A918_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "LDR     R4, =0xD640\n"
                "LDR     LR, [R4]\n"
                "LDR     R2, [R4,#8]\n"
                "CMP     LR, #0\n"
                "LDRNE   R3, [R4,#0xC]\n"
                "MOV     R5, R2\n"
                "CMPNE   R3, #1\n"
                "MOVEQ   R2, #0\n"
                "STREQ   R0, [R4]\n"
                "STREQ   R2, [R4,#0xC]\n"
                "BEQ     loc_FFD0A9E4\n"
                "LDR     R3, [R4,#4]\n"
                "LDR     R7, =table\n"            // +
                "ADD     R12, R3, R3,LSL#1\n"
                "LDR     R3, [R7,R12,LSL#2]\n"
                "ADD     R6, R7, #0x60\n"
                "LDR     R8, [R6,R12,LSL#2]\n"
                "SUB     R3, LR, R3\n"
                "CMP     R3, #0\n"
                "SUB     LR, LR, R8\n"
                "BLE     loc_FFD0A9A0\n"
                "ADD     R12, R7, R12,LSL#2\n"
                "LDR     LR, [R12,#4]\n"
                "CMP     LR, R3\n"
                "ADDGE   R2, R2, #1\n"
                "BGE     loc_FFD0A994\n"
                "LDR     R12, [R12,#8]\n"
                "CMP     R12, R3\n"
                "ADDLT   R2, R2, #3\n"
                "ADDGE   R2, R2, #2\n"
"loc_FFD0A994:\n"
           //   "CMP     R2, #0x17\n"   // -
           //   "MOVGE   R2, #0x16\n"   // -
                "CMP     R2, #0x1A\n"   // +
                "MOVGE   R2, #0x19\n"   // +
                "B       loc_FFD0A9D4\n"
"loc_FFD0A9A0:\n"
                "CMP     LR, #0\n"
                "BGE     loc_FFD0A9D4\n"
                "ADD     R3, R6, R12,LSL#2\n"
                "LDR     R12, [R3,#4]\n"
                "CMP     R12, LR\n"
                "SUBLE   R2, R2, #1\n"
                "BLE     loc_FFD0A9CC\n"
                "LDR     R3, [R3,#8]\n"
                "CMP     R3, LR\n"
                "SUBGT   R2, R2, #3\n"
                "SUBLE   R2, R2, #2\n"
"loc_FFD0A9CC:\n"
                "CMP     R2, #0\n"
                "MOVLT   R2, #0\n"
"loc_FFD0A9D4:\n"
                "CMP     R2, R5\n"
                "STRNE   R2, [R4,#8]\n"
                "MOVNE   R2, #1\n"
                "STRNE   R2, [R4,#0xC]\n"
"loc_FFD0A9E4:\n"
                "LDR     R2, =CompressionRateTable\n"   // +
                "LDR     R3, [R4,#8]\n"
                "LDR     R2, [R2,R3,LSL#2]\n"

                "LDR     R3, =video_mode\n"      // +
                "LDR     R3, [R3]\n"             // +
                "LDR     R3, [R3]\n"             // +
                "CMP     R3, #1\n"               // +
                "LDREQ   R3, =video_quality\n"   // +     
                "LDREQ   R3, [R3]\n"             // +     
                "LDREQ   R2, [R3]\n"             // +     

                "STR     R2, [R1]\n"
                "STR     R0, [R4]\n"
                "BL      mute_on_zoom\n"     // +
                "LDMFD   SP!, {R4-R8,PC}\n"
 );
} 

#include "conf.h"

int *video_quality = &conf.video_quality;
int *video_mode    = &conf.video_mode;

long def_table[48]={ 0x2000, 0x38D, 0x788, 0x5800, 0x9C5, 0x14B8, 0x10000, 0x1C6A, 0x3C45, 0x20000,
                     0x387A, 0x7813, 0x25800, 0x422F, 0x8CB6, 0x8000, 0xE35, 0x1E23, 0x10000, 0x1C6A,
                     0x3C45, 0x12C00, 0x2118, 0x465B, 0x1CCD, -0x2E1, -0x579, 0x4F33, -0x7EB, -0xF0C,
                     0xE666, -0x170A, -0x2BC6, 0x1CC39, -0x2F5B, -0x59F0, 0x21B53, -0x377F, -0x6965, 0x7333,
                    -0xB85, -0x15E3, 0xE666, -0x170A, -0x2BC6, 0x10DAA, -0x1BC0, -0x34B3};

long table[48];

void change_video_tables(int a, int b){
 int i;
 for (i=0;i<48;i++) table[i]=(def_table[i]*a)/b; 
}

long CompressionRateTable[]={0x60, 0x5D, 0x5A, 0x57, 0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 9, 7, 6, 5, 4, 3, 2, 1};
